#define _CRT_SECURE_NO_WARNINGS 1

#if 0
#include <iostream>
#include <stack>
#include <queue>
using namespace std;


void test01()
{
    class MinStack {
    public:
        MinStack() {

        }

        void push(int val) {
            _st.push(val);
            if (_minst.empty() || val <= _minst.top())
            {
                _minst.push(val);
            }
        }

        void pop() {
            if (_minst.top() == _st.top())
            {
                _minst.pop();
            }
            _st.pop();
        }

        int top() {
            return _st.top();
        }

        int getMin() {
            return _minst.top();
        }

    private:
        stack<int> _st;
        stack<int> _minst;
    };

    /**
     * Your MinStack object will be instantiated and called as such:
     * MinStack* obj = new MinStack();
     * obj->push(val);
     * obj->pop();
     * int param_3 = obj->top();
     * int param_4 = obj->getMin();
     */
}

int main()
{
	stack<int> st;
	st.push(1);
	st.push(2);
	st.push(3);
	st.push(4);

	while (!st.empty())
	{
		cout << st.top() << " ";
		st.pop();
	}
	cout << endl;

	queue<int> q;
	q.push(1);
	q.push(2);
	q.push(3);
	q.push(4);
	while (!q.empty())
	{
		cout << q.front() << " ";
		q.pop();
	}
	cout << endl;

	return 0;
}

#endif

#include <iostream>
#include "stack.h"
#include "queue.h"
using namespace std;


int main()
{
    My_stack_queue::stack<int> st;
    st.push(1);
    st.push(2);
    st.push(3);
    st.push(4);

    while (!st.empty())
    {
        cout << st.top() << " ";
        st.pop();
    }
    cout << endl;

    My_stack_queue::queue<int> q;
    q.push(1);
    q.push(2);
    q.push(3);
    q.push(4);

    while (!q.empty())
    {
        cout << q.front() << " ";
        q.pop();
    }
    cout << endl;

    return 0;
}